<template>
    <el-dialog
      :visible.sync="dialogShow"
      custom-class='errClass'
      width="80%"
      style="position: fixed;z-index: 9999999;"
      :before-close="handleClose">
      <div slot="title" class="header-title">
            <i class="el-icon-circle-close" style="color: #f56c6c;font-size:12px !important;margin-right: 4px;"></i>
            <span  >{{ title }}</span>
        </div>
      
      <div v-if="Array.isArray(contentArray)&&contentArray.length">
        <tableList 
              border
              maxHeight="200"
              :keySet="keySet"
              :tableData="contentArray"
              >
        </tableList>
      </div>
      <slot v-else></slot>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="handleClose">确 认</el-button>
      </span>
    </el-dialog>
</template>
  
  <script>
import tableList from '@/components/tableList/index.vue'


export default {
    name: 'errorDialog',
    data() {
        return {
          dialogShow: false,
          contentArray: [],
          title: '',
          keySet: [
                {
                    label: '问题发票',
                    englishName: 'num',
                },
                {
                    label: '问题列',
                    englishName: 'key', 
                },
                {
                    label: '问题描述',
                    englishName: 'value', 

                },
            ],
        }
    },
    methods: {
      handleClose(){
        this.$emit('change',false);
        this.dialogShow = false;
      },
      open(obj){
        this.dialogShow = obj.isShow;
        this.contentArray = obj.contentArray;
        this.title = obj.title || '错误信息';

      }
    },
    components:{
      tableList
    }
}
</script>
  
  <style lang="scss" scoped>
::v-deep .el-dialog__body{
  padding: 10px 20px;
}
.errClass{
  z-index: 100000;
}
</style>
  